package edu.uta.cfl.GUI;

import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;

public class OnlyResultsEditable {

	JTable table;
	DefaultTableModel model;
	int index = 0;
	public OnlyResultsEditable(JTable table,DefaultTableModel tableModel) {
		super();
		this.table = table;
		this.model = tableModel;
	}

	
	
	public void ResultColumnEditable()
	{
		
		JTableHeader th = table.getTableHeader();  
	    TableColumnModel tcm = th.getColumnModel();  
	    for(int x = 0, y = tcm.getColumnCount(); x < y; x++)  
	     {  
	         TableColumn tc = tcm.getColumn(x);  
	        // System.out.println("Column name = "+tc.getHeaderValue()+", width = "+tc.getWidth()+" Model Index"+tc.getModelIndex());  
	         if(tc.getHeaderValue() == "Results")
	         {
	        	 index = tc.getModelIndex();
	         }
	      } 
	  
	  
	    }
	    
	    
	}

